<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript Get Client Size</title>
</head>

<body>
  <span id="windowsize"></span>
  <p>
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  </p>
  <p>
  Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  </p>
  <script type="text/javascript">
  <!--
  var clientheight;
  var clientwidth;
  if (typeof window.innerHeight != 'undefined') {// the more standards compliant browsers
    clientheight = window.innerHeight;
    clientwidth = window.innerWidth;
  }
  else if (typeof document.documentElement.clientHeight != 'undefined') {// IE6 in standards compliant mode
    clientheight = document.documentElement.clientHeight;
    clientwidth = document.documentElement.clientWidth;
  }
  else {// older versions of IE
    clientheight = document.getElementByTagName('body')[0].clientHeight;
    clientwidth = document.getElementByTagName('body')[0].clientWidth;
  }

  //alert('height:'+clientheight+ 'width: ' + clientwidth);
  document.write('your viewport width is '+clientwidth+'x'+clientheight);

  //-->
  </script>
</body>
</html>